from multiprocessing import Process
from multiprocessing import Queue

q=Queue(3)

for i in range(3):
    print(q.qsize())
    q.put(i,timeout=2) #超时报异常

for i in range(3):
    print(q.get())